import { ref } from 'vue';

import { defineStore } from 'pinia';

import { getShopBindInfo } from '#/api';

import { auto1688Store } from './modules';

export const auto1688stor = defineStore('auth1688', () => {
  // const accessStore = useAccessStore();
  // const userStore = useUserStore();
  // const router = useRouter();
  const lodingGetShop = ref(false);
  const auto1688 = auto1688Store();
  async function auto1688BindShop(user_id?: any) {
    lodingGetShop.value = true;
    const res = await getShopBindInfo().catch(() => {
      lodingGetShop.value = false;
    });
    auto1688.set1688BindShop(res, user_id);
    lodingGetShop.value = false;
  }
  function $reset() {
    // loginLoading.value = false;
  }

  return {
    $reset,
    auto1688BindShop,
    auto1688,
    lodingGetShop,
  };
});
